<?php
session_start();
include_once("include.inc.php");
include_once("include.class.php");
CheckLogin();

$hidPageNow = $_POST['hidPageNow'];
$recordCount = $_POST['hidRecordCount'];

if(!is_numeric($recordCount)){
	$count = 'SELECT COUNT(*) as ct FROM tbl_special s,tbl_singer i WHERE i.singerID = s.singerID';
	if($result = $conn -> Execute($count)){
		$arrRow = $result->FetchRow();
		$recordCount = $arrRow['ct'];
	}
}

$sql = 'SELECT s.specialID,s.specialName,s.specialIntro,s.specialName,s.singerID,s.speciallPic,s.musicCount,s.typeID,s.langID,s.specialHits,s.commentCount,s.collectionCount,i.singerName FROM tbl_special s,tbl_singer i WHERE i.singerID = s.singerID';
$objPager = new Pager($recordCount,$sql,$hidPageNow,"fShowSpecialList");
if($result = $conn->Execute($objPager -> SetQuery())){
	while($arrRow = $result->FetchRow()){
		$arrSpecialList[] = $arrRow;
	}
}

$objSmarty -> assign("arrSpecialList",$arrSpecialList);
$objSmarty -> assign("hidPageNow",$hidPageNow);
$objSmarty -> assign("hidRecordCount",$recordCount);
$objSmarty -> assign("pager",$objPager->ShowMain().$objPager->ShowText().$objPager->ShowGoTo());
$objSmarty -> display("showSpecialList.html");
?>